package org.kl.bpm.entity.conf;

import java.sql.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import org.kl.bf.entity.Excel;
import org.kl.bf.entity.IdEntity;
import org.kl.bf.entity.basic.User;

import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * 
 * @Author hqm
 * @CreateTime 2014年5月25日 下午7:46:04
 */
@Entity
@Table(name = "BPM_DELEGATE_INFO")
public class BpmDelegateInfo extends IdEntity {
	private static final long serialVersionUID = 0L;
	private BpmProcess bpmProcess;
	@Excel(exportName = "委托人",exportProperty="trueName")
	private User assignee;
	@Excel(exportName = "被委托人",exportProperty="trueName")
	private User attorney;
	@Excel(exportName = "开始时间")
	private Date startTime;
	@Excel(exportName = "截止时间")
	private Date endTime;
	@Excel(exportName = "状态")
	private Integer status;

	public BpmDelegateInfo() {
	}

	public BpmDelegateInfo(User assignee, User attorney, Date startTime, Date endTime, BpmProcess bpmProcess, Integer status) {
		this.assignee = assignee;
		this.attorney = attorney;
		this.startTime = startTime;
		this.endTime = endTime;
		this.bpmProcess = bpmProcess;
		this.status = status;
	}

	/** @return null. */
	@ManyToOne
	@JoinColumn(name = "PROCESS_ID")
	public BpmProcess getBpmProcess() {
		return bpmProcess;
	}

	public void setBpmProcess(BpmProcess bpmProcess) {
		this.bpmProcess = bpmProcess;
	}

	@OneToOne
	@JoinColumn(name = "assignee")
	public User getAssignee() {
		return this.assignee;
	}

	/**
	 * @param assignee
	 *            null.
	 */
	public void setAssignee(User assignee) {
		this.assignee = assignee;
	}

	/** @return null. */
	@OneToOne
	@JoinColumn(name = "attorney")
	public User getAttorney() {
		return this.attorney;
	}

	/**
	 * @param attorney
	 *            null.
	 */
	public void setAttorney(User attorney) {
		this.attorney = attorney;
	}

	/** @return null. */
	@Column(name = "START_TIME", length = 26)
	// 设定JSON序列化时的日期格式
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
	public Date getStartTime() {
		return this.startTime;
	}

	/**
	 * @param startTime
	 *            null.
	 */
	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}

	/** @return null. */
	@Column(name = "END_TIME", length = 26)
	// 设定JSON序列化时的日期格式
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
	public Date getEndTime() {
		return this.endTime;
	}

	/**
	 * @param endTime
	 *            null.
	 */
	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}

	/** @return null. */
	@Column(name = "STATUS")
	public Integer getStatus() {
		return this.status;
	}

	/**
	 * @param status
	 *            null.
	 */
	public void setStatus(Integer status) {
		this.status = status;
	}
}
